<?php

/**
 * Description of UtenteDataManager
 *
 * @author rocco
 */
require_once  '../bean/InitProperties.php';

class InitPropertiesDataManager
{
    private static $instance;

    public static function getInstance()
    {
        if(self::$instance == null)
        {
            $c = __CLASS__;
            self::$instance = new $c;
        }
        return self::$instance;
    }



    public function  getInitProperties($connection)
    {
        $query = "Select chiave, valore from InitProperties ";
        if($stmt = $connection->prepare($query))
            $stmt->execute();

        $stmt->bind_result($chiave, $valore);

        $lista = array();
        while ($stmt->fetch())
        {
            $initProperties = new InitProperties();
            $initProperties->setChiave($chiave);
            $initProperties->setValore($valore);
            $lista[$chiave] = $valore;
        }
        $stmt->close();
        return $lista;
    }


}
?>
